#define _CRT_SECURE_NO_WARNINGS
#include <iostream>
#include <vector>

using namespace std;

int maxProduct(vector<int>& nums) {
    int n = nums.size();
    vector<int> f(n + 10, 1);
    vector<int> g(n + 10, 1);
    int ret = INT_MIN;
    for (int i = 1; i <= n; ++i)
    {
        int x = nums[i - 1];
        int y = nums[i - 1] * f[i - 1];
        int z = nums[i - 1] * g[i - 1];
        f[i] = max(x,max(y,z));
        g[i] = min(x,min(y,z));
        ret = max(ret, f[i]);
    }

    return ret;
}

int main()
{

	return 0;
}